//
//  NavViewController.m
//  niminban
//
//  Created by zhouteng on 16/10/6.
//  Copyright © 2016年 zhouteng. All rights reserved.
//

#import "NavViewController.h"
#import "MainViewController.h"

@interface NavViewController ()

@end

@implementation NavViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(void)update:(NSString *)id page:(NSInteger)page{
    while(self.topViewController == nil || ![self.topViewController isKindOfClass:[MainViewController class]]){
        [self popViewControllerAnimated:NO];
    }
    if(self.topViewController){
        MainViewController *vc = (MainViewController *)self.topViewController;
        [vc update:id page:page];
    }
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
